<template>
   <div>
        <div>姓名:{{name}}</div>
        <div>生日:{{birthday|formatDate}}</div>
        <div>{{str|capitalize}}</div>
        <div>{{url|httpUrl}}</div>
        <div>
            <a :href="url|httpUrl">链接到giles网站</a>
        </div>
   </div>
</template>

<script>
export default {
    data(){
        return{
            name:'张三丰',
            birthday:new Date(1980,4,7),
            str:'helloworld',
            url:'www.zhaijizhe.cn'
        }
    },
    //私有过滤器，局部过滤器
    filters:{
        formatDate(arg){
            return arg.getFullYear()+"-"+arg.getMonth()+"-"+arg.getDate()
        },
        httpUrl(arg){
            return `http://${arg}`
        }
    }
}
</script>

<style>

</style>